package com.ziyueyuwen.xiniao.service;

import com.alibaba.fastjson.JSONObject;
import com.ziyueyuwen.xiniao.bean.ao.LessonSaveAO;
import com.ziyueyuwen.xiniao.bean.ao.LessonUpdateVO;
import com.ziyueyuwen.xiniao.bean.ao.TransferStudentAO;
import com.ziyueyuwen.xiniao.bean.ZyClassLessonInfo;
import com.ziyueyuwen.xiniao.bean.page.PageData;
import com.ziyueyuwen.xiniao.bean.query.LessonQuery;
import com.ziyueyuwen.xiniao.bean.vo.LessonInfoPageVO;
import com.ziyueyuwen.xiniao.bean.vo.LessonUserMessageVO;
import com.ziyueyuwen.xiniao.bean.vo.ZyClassUserVO;
import com.ziyueyuwen.xiniao.bean.vo.ZyLessonVO;
import com.ziyueyuwen.xiniao.enums.MessageTypeEnum;

import java.util.List;
import java.util.Map;

/**
 * @author wancheng  on 2018/12/21.
 */
public interface LessonService {
    /**
     * 获取班级的所有课节
     *
     * @param classId
     * @return
     */
    List<ZyClassLessonInfo> getClassLesson(Integer classId);

    /**
     * 获取学生课节
     * @param classId
     * @param userAccount
     * @return
     */
    Map<String, Object> getStudentLessonByClassId(Integer classId,String userAccount);

    /**
     * 获取课前预习,作业,回放链接
     * @param lessonId
     * @param userAccount
     * @return
     */
    ZyLessonVO getStudentLessonTaskByLessonId(Integer lessonId, String userAccount);

    /**
     * 获取课节的班级和课程信息
     *
     * @param lessonId
     * @return
     */
    ZyLessonVO getClassAndCourseByLessonId(Integer lessonId);

    /**
     * 每个课节学生任务情况
     *
     * @param lessonId
     * @return
     */
    List<LessonUserMessageVO> lessonUserMessage(Integer lessonId);

    /**
     * 学生点击
     *
     * @param lessonId
     * @param userAccount
     * @param typeEnum
     * @throws Exception
     */
    void confirmLessonTask(Integer lessonId, String userAccount, MessageTypeEnum typeEnum) throws Exception;

    /**
     * 学生课堂报告数据收集
     * @param lessonId
     * @param userAccount
     * @param typeEnum
     */
    void studentLessonReportDataCollect(Integer lessonId, String userAccount, MessageTypeEnum typeEnum);

    /**
     * 添加排课
     * @param lessonSave
     * @param createUserAccount
     * @return
     * @throws Exception
     */
    List<ZyClassLessonInfo> saveLesson(LessonSaveAO lessonSave, String createUserAccount) throws Exception;

    /**
     * 删除课节
     * @param lessonId
     * @param deleteUserAccount
     * @throws Exception
     */
    void deleteLesson(Integer lessonId,String deleteUserAccount) throws Exception;

    /**
     * 添加插班生
     * @param transferStudent
     * @return
     * @throws Exception
     */
    JSONObject updateTransferStudent(TransferStudentAO transferStudent) throws Exception;

    /**
     * 课节分页查询
     * @param query
     * @return
     */
    PageData getLessonForPage(LessonQuery query);

    /**
     * id获取课节数据
     * @param lessonId
     * @return
     */
    LessonInfoPageVO getByLessonId(Integer lessonId);

    /**
     * 修改课节
     * @param lessonUpdate
     * @param updateUserAccount
     * @throws Exception
     */
    void updateLesson(LessonUpdateVO lessonUpdate, String updateUserAccount) throws Exception;

    /**
     * 获取所有的老师,班级老师优先
     * @param classId
     * @return
     */
    List<ZyClassUserVO> getClassTeacher(Integer classId);

    /**
     * 添加或删除班级 调整该班级下所有课节的顺讯
     * @param classId
     */
    void arrangeClassLesson(Integer classId);

    /**
     * 通过eeoClassId获取课节
     * @param eeoClassId
     * @return
     */
    ZyClassLessonInfo getLessonInfoByEeoClassId(Integer eeoClassId);

    /**
     * 主键获取
     * @param lessonId
     * @return
     */
    ZyClassLessonInfo getByPreKey(Integer lessonId);

}
